# -*- codeing = utf-8 -*-
# @Time : 2021/2/26 20:43
# @Atuthor: 朱朱
# @File: 125面向对象练习2.py
# @Software: PyCharm

class Auto(object):
    def __init__(self, color, weight, speed = 0, wheel_count =4):
        self.color = color
        self.weight = weight
        self.speed = speed
        self.wheel_count = wheel_count

    def change_speed(self, x:int):
        """
        修改车速
        :param x: 车速值 正数:加速     负数:减速   0:停车
        :return:
        """
        if x == 0:
            self.speed = 0
            print( '停车')
        elif x >= 0:
            self.speed =x
            print('行驶中')
        elif x <=0:
            self.speed=x
            print('减速中..')
        else:
            return


class CarAuto(Auto):
    def __init__(self,color, weight, ac, navigator, speed = 0,wheel_count=4):
        super(CarAuto, self).__init__(color,weight,speed,wheel_count)
        self.navigator = navigator
        self.ac = ac


car = CarAuto('白色',1.6,'美国','ios',0,5)
print(car.color)
print(car.weight)
print(car.navigator)
print(car.ac)
car.change_speed(-9)
print(car.speed)
print(car.wheel_count)